package entity

import (
	"github.com/lib/pq"
)

type EbikeType struct {
	ID int64 `gorm:"column:id;type:BIGINT;primary_key" json:"id"`

	SocketType int `gorm:"column:socket_type;type:TINYINT" json:"socket_type"`

	Name string `gorm:"column:name;type:VARCHAR(255)" json:"name"`

	Color pq.StringArray `gorm:"column:color;type:VARCHAR(255)" json:"color"`

	Status int `gorm:"column:status;type:TINYINT" json:"status"`

	ParentID int64 `gorm:"column:parent_id;type:BIGINT" json:"parent_id"`

	Price int `gorm:"column:price;type:TINYINT" json:"price"`

	ImagePath pq.StringArray `gorm:"column:image_path;type:VARCHAR" json:"image_path"`

	Image string `json:"image"`

	Code string `json:"code"`

	Config string `json:"config"`

	CreatedAt int64 `gorm:"column:created_at;type:BIGINT" json:"created_at"`

	UpdatedAt int64 `gorm:"column:updated_at;type:BIGINT" json:"updated_at"`

	ConfigUpdatedAt int64 `gorm:"column:config_update_at;type:BIGINT" json:"config_updated_at"`
}

func (a *EbikeType) TableName() string {
	return "ebike_types"
}
